# Contributor: Pascal Hofmann <mail@pascalhofmann.de>
# Contributor: Mickaël Remars <github@remars.com>
# Maintainer: Mickaël Remars <github@remars.com>
_pkgreal=rrd
pkgname=php7-pecl-rrd
pkgver=2.0.1
pkgrel=1
pkgdesc="PHP7 bindings to rrd tool system"
url="https://pecl.php.net/package/rrd"
arch="all"
license="BSD-2-Clause" # just one word difference: "owner" in php-rrd's license, "holder" in bsd-2-clause
depends="php7-common"
makedepends="php7-dev re2c rrdtool-dev"
checkdepends="rrdtool"
source="$pkgname-$pkgver.tgz::http://pecl.php.net/get/$_pkgreal-$pkgver.tgz"
builddir="$srcdir/$_pkgreal-$pkgver"

build() {
	phpize7
	./configure --prefix=/usr --with-php-config=php-config7
	make
}

check() {
	make NO_INTERACTION=1 REPORT_EXIT_STATUS=1 test
}

package() {
	local confdir="$pkgdir/etc/php7/conf.d"

	make INSTALL_ROOT="$pkgdir" install

	mkdir -p "$confdir"
	echo "extension=$_pkgreal.so" > "$confdir"/20_$_pkgreal.ini
}

sha512sums="b6f7173f54fcf49bf014cc6c78263c169cdf53dac66c12f5f88db7e01b49ea74da84a55f61deb25c866e6e2e74275ec48fc4a3d1b46719f66b5b7b7eb000b6b3  php7-pecl-rrd-2.0.1.tgz"
